wayland: Bind the appropriate OpenGL API
authorEmmanuele Bassi <ebassi@gnome.org>
Sat, 23 Apr 2016 09:13:39 +0000 (10:13 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Mon, 25 Apr 2016 11:29:37 +0000 (12:29 +0100)
If we want to use OpenGL ES with EGL then we need to bind the API before
creating the EGL context.

gdk/wayland/gdkglcontext-wayland.c

index 8ae39420d3d78c1948a9efdc4aef37a1ad673023..b43b9b67c222d9a56fe3fe56027dda02abba40ad 100644 (file)
@@ -134,6 +134,8 @@ gdk_wayland_gl_context_realize (GdkGLContext *context,
 
   if (!use_es)
     {
+      eglBindAPI (EGL_OPENGL_API);
+
       /* We want a core profile, unless in legacy mode */
       context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
       context_attribs[i++] = legacy_bit
@@ -148,6 +150,8 @@ gdk_wayland_gl_context_realize (GdkGLContext *context,
     }
   else
     {
+      eglBindAPI (EGL_OPENGL_ES_API);
+
       context_attribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
       if (major == 3)
         context_attribs[i++] = 3;
@@ -184,6 +188,8 @@ gdk_wayland_gl_context_realize (GdkGLContext *context,
       context_attribs[3] = 3;
       context_attribs[5] = 0;
 
+      eglBindAPI (EGL_OPENGL_API);
+
       legacy_bit = TRUE;
       use_es = FALSE;